<template>
  <el-dialog
    title="编辑圈子排序"
    :visible.sync="dialogData.isShow"
    width="20%">

    <div style="padding:30px; padding-left: 75px;">
      <el-input-number v-model="dialogData.num" :min="0"></el-input-number>
    </div>

    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogData.isShow = false">取 消</el-button>
      <el-button type="success" @click="handleSortConfirm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import { circleOrder } from '@/api/circle/circleManage'
  export default {
    props: ['dialogData'],
    methods: {
      handleSortConfirm() {
        let { id, num } = this.dialogData
        circleOrder( { id, num }, (res) => {
          this.dialogData.isShow = false
          this.$emit('refresh')
        }, (err) => {
          this.$message({
            message: err.message,
            type: 'warning'
          })
        })
      }
    }
  }
</script>